FROM node:lts as webBuilder
MAINTAINER livo

ADD ./ /ckeditor_sample
WORKDIR /ckeditor_sample
RUN cd /ckeditor_sample/ckeditor5-custom && npm install && npm run build \
    && cd /ckeditor_sample \
    && npm link ./ckeditor5-custom \
    && npm install --production && npm run-script build

FROM nginx
MAINTAINER livo
ENV TZ : 'Asia/Shanghai'
COPY --from=webBuilder /ckeditor_sample/build /usr/share/nginx/html